NUKE surface sorting by fog#1610
Conversation
Can you really merge surfaces of different fogs though? It seems like they have some parameters which could be different such as |
You can't merge the actual fog surfaces, but you can merge the "main" surfaces that emitted them. Although I'll need to make the main surfaces not use the actual fognum for that to work, otherwise the backend still won't merge them. |
|
Right, now I get it. You want to sort by fog num for fog surfaces, but not surfaces in the fog. LGTM To get fog surfaces sorted/merged properly, maybe it would be easiest to just generate a |
|
That is correct, yeah. I've thought of generating the |
DaemonEngine#1408 had removed the hacky way of drawing fog surfaces and made them into actual stages. This change removes the sorting by fog index since it now has no positive effect (and potentially has a negative one, preventing surfaces from being merged). The fognum bits are redistributed towards drawsurf indexes and entity count.
These surfaces themselves won't be used to render fog, instead that is done by adding surfaces referencing the same geometry, but using one of `tr.fogEqualShader` or `tr.fogLEShader`.
|
I've added two more commits that set fogNum on main surfaces to 0 so they can be merged, and fix a comment on drawSurf sort. |
#1408 had removed the hacky way of drawing fog surfaces and made them into actual stages. This change removes the sorting by fog index since it now has no positive effect (and potentially has a negative one, preventing surfaces from being merged). The fognum bits are redistributed towards drawsurf indexes and entity count.
This will also allow increasing
MAX_REF_ENTITIES.